# Maintainer: Daniel M. Capella <polyzen@archlinux.org>
# Contributor: Darshit Shah <darnir@gmail.com>

_name=ansicolor
pkgname=python-ansicolor
pkgver=0.3.2
pkgrel=5
pkgdesc='Library to produce ansi color output and colored highlighting and diffing'
arch=('any')
url=https://github.com/numerodix/ansicolor
license=('Apache')
depends=('python')
makedepends=('python-build' 'python-installer' 'python-setuptools'
             'python-wheel')
checkdepends=('python-pytest')
source=("https://files.pythonhosted.org/packages/source/${_name::1}/$_name/$_name-$pkgver.tar.gz")
sha256sums=('3b840a6b1184b5f1568635b1adab28147947522707d41ceba02d5ed0a0877279')
b2sums=('c7f3287645ec3c1b02280b2ac4da0051ba1a88b71c09516f98103787ae2d09bed7b441ecb8cea9796f24f3935154cf1bc4180d12842f8ed1c6e024a066fa228a')

build() {
  cd $_name-$pkgver
  python -m build --wheel --skip-dependency-check --no-isolation
}

check() {
  cd $_name-$pkgver
  python -m venv --system-site-packages test-env
  test-env/bin/python -m installer dist/*.whl
  test-env/bin/python -m pytest
}

package() {
  cd $_name-$pkgver
  python -m installer --destdir="$pkgdir" dist/*.whl
}
